<template>
	<view class="content">
		<view class="balbox">
			<view>
				<text>当前余额:</text><text class="price">{{balance}}</text>
			</view>
		 
		</view>
		<view class="itembox">
		  <view class="item" v-for="(item,index) in loglist" :key="index">
			  <view class="item1">
				  <text>{{item.memo}}</text>
				  <text>{{item.money}}</text>
			 </view>
			 <view class="item2">
			 				  <text>{{item.createtime_text}}</text>
			 				  <text>余额{{item.after}}</text>
			 </view> 
		  </view>	
		 	
		  
		</view>
		<uni-load-more :status="loadingType"></uni-load-more>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				balance:0,
				page:1,
				pagesize:6,
				loglist:[],
					loadingType: 'more', //加载更多状态
			}
		},
		onLoad() {
			this.getlist();
		},
		methods: {
			onReachBottom() {
				this.getlist();
			
			},
			getlist(){
				let that = this;
				let param={};
				this.$util.req('/user/getScorelog', param, false, function(res) {
				    that.balance = res.data.balance;
					that.loglist = that.loglist.concat(res.data.list);
					that.loadingType = res.data.list.length >= 10 ? 'more' : 'nomore';
					that.page += 1;
				 
				 
				});
			}
		}
	}
</script>

<style lang="scss">
page,
	.content {
		background: $page-color-base;
		height: 100%;
		
	}
	.balbox{
		padding: 20upx 10upx;
		background-color: #FFFFFF;
		display: flex;
		align-items: baseline;
		justify-content: space-between;
		.price{
		 color: #FF5A5F;
	    }
		.rechargebtn{
			padding: 10upx 30upx;
			background-color: #FF5A5F;
			border-radius: 10upx;
			color: #FFFFFF;
		}
	}
	.itembox{
		margin-top: 20upx;
		background-color: #FFFFFF;
		padding: 20upx 10upx;
		display: flex;
		flex-direction: column;
		.item{
			display: flex;
			flex-direction: column;
			
		    border-bottom: 1upx solid $border-color-base;
		.item1,.item2{
			display: flex;
			justify-content: space-between;
			 padding: 10upx 0;
		}
		.item2{
			font-size: $font-base;
			color: $font-color-disabled;
		}
		}
	}
</style>
